export default function getBar1(ageDist: any) {
  const { man = [], woman = [], range = [] } = ageDist || {};
  return {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow',
      },
    },
    legend: {
      data: ['男', '女'],
      align: 'right',
      right: 10,
      itemWidth: 10,
      itemHeight: 10,
      itemGap: 35,
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      top: '10%',
      containLabel: true,
    },
    xAxis: [
      {
        type: 'category',
        data: range,
        axisLine: {
          show: true,
          lineStyle: {
            color: '#dcdcdc',
            width: 1,
            type: 'solid',
          },
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          show: true,
          color: '#333333',
        },
      },
    ],
    yAxis: [
      {
        type: 'value',
        minInterval: 1,
        axisLabel: {
          formatter: '{value}人',
          color: '#333333',
        },
        axisTick: {
          show: false,
        },
        axisLine: {
          show: false,
          lineStyle: {
            color: '#dcdcdc',
            width: 1,
            type: 'solid',
          },
        },
        splitLine: {
          lineStyle: {
            color: '#dcdcdc',
          },
        },
      },
    ],
    series: [
      {
        name: '男',
        type: 'bar',
        data: man,
        barWidth: 20,
        itemStyle: {
          color: '#89b1f6',
          opacity: 1,
        },
      },
      {
        name: '女',
        type: 'bar',
        data: woman,
        barWidth: 20,
        itemStyle: {
          color: '#e384cf',
          opacity: 1,
        },
      },
    ],
  };
}
